package efu.nf.like.common.config;

import org.springframework.amqp.support.converter.Jackson2JsonMessageConverter;
import org.springframework.amqp.support.converter.MessageConverter;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lwj
 * @create 2025-10-12-23:28
 */
@Configuration
public class RabbitConfig {
    /**
     * 交换机名称
     */
    public static final String EXCHANGE_NAME = "like.exchange";
    /**
     * 队列名称
     */
    public static final String QUEUE_NAME = "like.queue";
    /**
     * 路由键
     */
    public static final String ROUTING_KEY = "like.key";

    /**
     * 替换默认的 SimpleMessageConverter 序列化器
     * @return
     */
    @Bean
    public MessageConverter messageConverter(){
        Jackson2JsonMessageConverter converter = new Jackson2JsonMessageConverter();
        return converter;
    }
}
